<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div style="margin-left: 400px">
        <h3>if的使用</h3>
        <p>th:if当条件为真的时候显示</p>
        <p th:if="${sex == 'm'}">性别是男</p>
        <p th:if="${isLogin}">已经登录系统</p>
        <p th:if="${age > 20}">年龄大于20</p>
        <!--空字符串是true-->
        <p th:if="${name}">name是空的</p>
        <!--null是false-->
        <p th:if="${isOld}">isOld是null</p>
    </div>

    <hr>
    <div style="margin-left: 400px">
        <h3>unless：判断条件为false显示标签体的内容</h3>
        <p th:unless="${sex == 'f'}">标签是男的</p>
        <p th:unless="${isLogin}">登录系统</p>
        <p th:unless="${isOld}">isOld是Null</p>
    </div>
</body>
</html>